//
//  ByShapeModel.h
//  laserdevice_ios
//
//  Created by pro on 16/11/26.
//  Copyright © 2016年 com.itboye. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "ByShapeLayerView.h"                        // 图层视图

typedef enum : NSUInteger {
    ByShapeModeLine,
    ByShapeModeAngle,
    ByShapeModeTriangle,
    ByShapeModeSquare,
    ByShapeModeTrapezoid,
    ByShapeModeCuboids,
} ByShapeMode;

// 一个图形，所拥有的属性
@interface ByShapeModel : NSObject <NSCopying>

- (instancetype)initWithMode:(ByShapeMode)mode;

- (instancetype)initWithJsonDic:(NSDictionary *)dic sceneName:(NSString *)sceneName;

@property (nonatomic, copy) NSString *name;                 // 名称
@property (nonatomic, strong) UIImage *picture;             // 图片

@property (nonatomic, assign) BOOL selected;                // 是否是选中

@property (nonatomic, assign) ByShapeMode mode;             // 图形类型
@property (nonatomic, strong) NSMutableArray *points;       // NSValue-point
//@property (nonatomic, copy) NSArray *movePoints;            // NSValue-point

@property (nonatomic, strong) UIBezierPath *movePath;             // UIBeizePaths
@property (nonatomic, copy) NSArray *movePaths;            // UIBeizePaths


@property (nonatomic, strong) NSMutableArray *labels;       // 图形的属性label（长，宽等）
@property (nonatomic, strong) NSMutableArray *attributes;   // 图形的属性值（长，宽等）

@property (nonatomic, strong) UILabel *highLightLabel;      // 高亮线段
- (void)setHighLightLabel:(UILabel *)highLightLabel distance:(NSString *)distance;


// 控制立方体变换的四个点，只有模型为立方体时才拥有该值（分别控制，长，宽，高，整体）
@property (nonatomic, strong) NSMutableArray *cuboidsControllPoints;
// 立方体绘制上面的四个点
@property (nonatomic, strong) NSMutableArray *cuboidsDrawUpPoints;
// 立方体绘制下面的四个点
@property (nonatomic, strong) NSMutableArray *cuboidsDrawDownPoints;

@property (nonatomic, strong) ByShapeLayerView *pointView;  // 点视图
@property (nonatomic, strong) ByShapeLayerView *lineView;   // 线视图
@property (nonatomic, strong) ByShapeLayerView *moveView;   //
@property (nonatomic, strong) ByShapeLayerView *angleView;  // 角度视图


// 高亮处理
@property (nonatomic, strong) NSMutableArray *highLightPoints;       // NSValue-point
@property (nonatomic, strong) ByShapeLayerView *highLightLineView;


// 获取可移动的点
//- (NSArray *)movePointsFormPoints:(NSArray *)points;
//- (NSArray *)movePointsForCuboids;
- (NSArray *)movePathsForCuboids;
- (UIBezierPath *)movePathForNormal;

// 调整label的位置
- (void)adjustLabelsFrame;

// 用于保存的字典
- (NSMutableDictionary *)saveDictionary;
@end
